fbace1f705d50e1ca49b218bf0a3b457573dff05
[openwrt/openwrt.git] /
1 From patchwork Wed May 21 22:45:39 2025
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
6 X-Patchwork-Id: 14096122
7 X-Patchwork-Delegate: quic_jjohnson@quicinc.com
8 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com
9 [205.220.180.131])
10 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
11 (No client certificate requested)
12 by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A1E9239E85
13 for <linux-wireless@vger.kernel.org>; Wed, 21 May 2025 22:45:59 +0000 (UTC)
14 Authentication-Results: smtp.subspace.kernel.org;
15 arc=none smtp.client-ip=205.220.180.131
16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
17 t=1747867561; cv=none;
18 b=YNQGoLeTsEUX0an1dYT8uFrTBxczoxLPoB0nXP+MEP3YMcemaxVf4zoi5GMSuKPLe4yeLz/R7AB090SrXrBTbY6MmwXLrUJGFBQUGwr05KQ5BnedSLyVE+PtNo01ZVjrjprsc5LC4z0vYHmQdBsqIfqP+bb+ATVkdkkKWV4Kg3A=
19 ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
20 s=arc-20240116; t=1747867561; c=relaxed/simple;
21 bh=WkoD1wqfpiPds2ZNAwn7TY38LnC6cJOAuobqk3tWbSk=;
22 h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
23 MIME-Version:Content-Type;
24 b=aAO1mDb/PrwqKRHoeS0PAxgJAvDLPWPPBkzRX0hwJbFzcXtKdtWHDE83rjGbjR1bnM7lhkAU4SwoT87sOuciveNqdywUe6+9XTB2oWM/j0Tza/ZRKKRZFeByh7ib8Aibzc4y0ACg7Oaz/QhmWmPObPjc4oKuVzaH/P8Tub0rBcI=
25 ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
26 dmarc=pass (p=none dis=none) header.from=quicinc.com;
27 spf=pass smtp.mailfrom=quicinc.com;
28 dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
29 header.b=o3M+Sjyr; arc=none smtp.client-ip=205.220.180.131
30 Authentication-Results: smtp.subspace.kernel.org;
31 dmarc=pass (p=none dis=none) header.from=quicinc.com
32 Authentication-Results: smtp.subspace.kernel.org;
33 spf=pass smtp.mailfrom=quicinc.com
34 Authentication-Results: smtp.subspace.kernel.org;
35 dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
36 header.b="o3M+Sjyr"
37 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1])
38 by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
39 54LJHZNq001758;
40 Wed, 21 May 2025 22:45:56 GMT
41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
42 cc:content-transfer-encoding:content-type:date:from:in-reply-to
43 :message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
44 wh8AVrVaz3Wne8xUCnRodQGPYbrNE8Rm9/NepU3KoQA=; b=o3M+SjyriKBrU+dH
45 +Uwb/f5RzskxDlOAgOvwNH7O5p766ueJYE/nAazyAuVI1fbDT1gkgvOM4VOLQAPP
46 zg9tDUD5Mz80GzBzSnheYbeedz7RgpaN14Qr6Gz/+1yrP4wWTh2quGduIAXBFDZR
47 QpWsQh2DxVOvXqoLRm64iurJNhvpq+YIAwpAxEA9Fp46SrXsFefc82nza6qgdk5P
48 pUjalFWnwLLxaSHJj2EoJhFDAf99q9N5KNKW/UCNY8A2CwQXqL9KmggTLRK1OC+S
49 ueHigeV9ydoGGD1W6zmEdydGv5JSaQRhjAxtJokUtrlUwn8mbpJyokm+Ie4GZV5v
50 tie1qQ==
51 Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com
52 [129.46.96.20])
53 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwf6vbsg-1
54 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
55 Wed, 21 May 2025 22:45:56 +0000 (GMT)
56 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
57 [10.47.209.196])
58 by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
59 54LMjtcB022245
60 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
61 Wed, 21 May 2025 22:45:55 GMT
62 Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by
63 nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
64 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
65 15.2.1544.9; Wed, 21 May 2025 15:45:54 -0700
66 From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
67 To: <ath12k@lists.infradead.org>
68 CC: <linux-wireless@vger.kernel.org>,
69 Pradeep Kumar Chitrapu
70 <quic_pradeepc@quicinc.com>,
71 Jeff Johnson <quic_jjohnson@quicinc.com>
72 Subject: [PATCH ath-next V14 9/9] wifi: ath12k: add extended NSS bandwidth
73 support for 160 MHz
74 Date: Wed, 21 May 2025 15:45:39 -0700
75 Message-ID: <20250521224539.355985-10-quic_pradeepc@quicinc.com>
76 X-Mailer: git-send-email 2.43.0
77 In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com>
78 References: <20250521224539.355985-1-quic_pradeepc@quicinc.com>
79 Precedence: bulk
80 X-Mailing-List: linux-wireless@vger.kernel.org
81 List-Id: <linux-wireless.vger.kernel.org>
82 List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
83 List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
84 MIME-Version: 1.0
85 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
86 nalasex01a.na.qualcomm.com (10.47.209.196)
87 X-QCInternal: smtphost
88 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
89 signatures=585085
90 X-Proofpoint-GUID: 3XlPaBNySyE2wx5TC6p1DVWVXzadsV9U
91 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNiBTYWx0ZWRfX4g8vKznbpwuH
92 ZKoHe/eZESaXJ/nU0MF27s2mZH9kbhxkG1nYDBAxgIAR6HSB4Ir8V8BP9wvETNPaaV4xpgjbT6m
93 sDGIplm3HpwbpmQYiBtQIsOrs/s1B2t7uVdhqW02FHlFu/UIBLwZc7J8sLJcsYdxHYcx7MQ3nEe
94 tDoPrPTEwHw7n1CnzcfVsEUAuxuJ5iFaxBATgZF+LuAhijNvhyaoEWRUO2KUcBJaFHq/QbCYfpY
95 JBXWUNl+mlZxfQe4pogCpRmvEOONRvpKgZLFdEAxf2Fx0Z7OhaIV84gi99TYTjfe1aihjorJ/cp
96 cv78Jzcd3Pe3GwTFD0ZOqI30oSiaUyJS3E9XIjfDGLAVMK6FeM+KOYgnqo95ImgBH8HRshrA4LJ
97 qTKv2kKP1y4zPtpf7lmI2mcl7emiLGQx+t0d7Z8upCbYseoNAGHUkFJ45HF940Za9ZkEYTRq
98 X-Authority-Analysis: v=2.4 cv=fZOty1QF c=1 sm=1 tr=0 ts=682e57a4 cx=c_pps
99 a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17
100 a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=Opr4SxZhII4Vei-TI5AA:9
101 a=TjNXssC_j7lpFel5tvFf:22
102 X-Proofpoint-ORIG-GUID: 3XlPaBNySyE2wx5TC6p1DVWVXzadsV9U
103 X-Proofpoint-Virus-Version: vendor=baseguard
104 engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40
105 definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01
106 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
107 clxscore=1015 mlxscore=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0
108 malwarescore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999
109 lowpriorityscore=0 phishscore=0 classifier=spam authscore=0 authtc=n/a
110 authcc= route=outbound adjust=0 reason=mlx scancount=1
111 engine=8.19.0-2505160000 definitions=main-2505210226
112
113 Currently rx and tx MCS map for 160 MHz under HE capabilities
114 are not updating properly, when 160 MHz is configured with NSS
115 lesser than max NSS support. Fix this by utilizing
116 nss_ratio_enabled and nss_ratio_info fields sent by firmware
117 in service ready event.
118
119 However, if firmware advertises EXT NSS BW support in VHT caps
120 as 1(1x2) and when nss_ratio_info indicates 1:1, reset the EXT
121 NSS BW Support in VHT caps to 0 which indicates 1x1. This is
122 to avoid incorrectly choosing 1:2 NSS ratio when using the
123 default VHT caps advertised by firmware.
124
125 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
126
127 Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
128 Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
129 ---
130 drivers/net/wireless/ath/ath12k/mac.c | 33 ++++++++++++++++++++++-----
131 1 file changed, 27 insertions(+), 6 deletions(-)
132
133 --- a/drivers/net/wireless/ath/ath12k/mac.c
134 +++ b/drivers/net/wireless/ath/ath12k/mac.c
135 @@ -2726,8 +2726,10 @@ static void ath12k_peer_assoc_h_he(struc
136 arg->peer_nss = min(link_sta->rx_nss, max_nss);
137
138 if (arg->peer_phymode == MODE_11AX_HE160) {
139 - tx_nss = ath12k_get_nss_160mhz(ar, max_nss);
140 + tx_nss = ath12k_get_nss_160mhz(ar, ar->num_tx_chains);
141 rx_nss = min(arg->peer_nss, tx_nss);
142 +
143 + arg->peer_nss = min(link_sta->rx_nss, ar->num_rx_chains);
144 arg->peer_bw_rxnss_override = ATH12K_BW_NSS_MAP_ENABLE;
145
146 if (!rx_nss) {
147 @@ -6912,6 +6914,12 @@ ath12k_create_vht_cap(struct ath12k *ar,
148 vht_cap.vht_mcs.rx_mcs_map = cpu_to_le16(rxmcs_map);
149 vht_cap.vht_mcs.tx_mcs_map = cpu_to_le16(txmcs_map);
150
151 + /* Check if the HW supports 1:1 NSS ratio and reset
152 + * EXT NSS BW Support field to 0 to indicate 1:1 ratio
153 + */
154 + if (ar->pdev->cap.nss_ratio_info == WMI_NSS_RATIO_1_NSS)
155 + vht_cap.cap &= ~IEEE80211_VHT_CAP_EXT_NSS_BW_MASK;
156 +
157 return vht_cap;
158 }
159
160 @@ -7092,11 +7100,12 @@ static void ath12k_mac_set_hemcsmap(stru
161 struct ieee80211_sta_he_cap *he_cap)
162 {
163 struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
164 - u16 txmcs_map, rxmcs_map;
165 + u8 maxtxnss_160 = ath12k_get_nss_160mhz(ar, ar->num_tx_chains);
166 + u8 maxrxnss_160 = ath12k_get_nss_160mhz(ar, ar->num_rx_chains);
167 + u16 txmcs_map_160 = 0, rxmcs_map_160 = 0;
168 + u16 txmcs_map = 0, rxmcs_map = 0;
169 u32 i;
170
171 - rxmcs_map = 0;
172 - txmcs_map = 0;
173 for (i = 0; i < 8; i++) {
174 if (i < ar->num_tx_chains &&
175 (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
176 @@ -7109,12 +7118,24 @@ static void ath12k_mac_set_hemcsmap(stru
177 rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
178 else
179 rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
180 +
181 + if (i < maxtxnss_160 &&
182 + (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
183 + txmcs_map_160 |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
184 + else
185 + txmcs_map_160 |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
186 +
187 + if (i < maxrxnss_160 &&
188 + (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
189 + rxmcs_map_160 |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
190 + else
191 + rxmcs_map_160 |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
192 }
193
194 mcs_nss->rx_mcs_80 = cpu_to_le16(rxmcs_map & 0xffff);
195 mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff);
196 - mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff);
197 - mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff);
198 + mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map_160 & 0xffff);
199 + mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map_160 & 0xffff);
200 }
201
202 static void ath12k_mac_copy_he_cap(struct ath12k *ar,